package com.zj.classwork;
import java.util.Scanner;
public class ClassWork15 {
    public static void main(String[] args) {
         Scanner input=new Scanner(System.in);
         int count=1;
         while (count<=3)
         {
             System.out.println("请输入用户名：");
             String username= input.next();
             System.out.println("请输入密码：");
             String password= input.next();
             if("jim".equals(username)&&"123456".equals(password))
             {
                 System.out.println("欢迎登录MyShopping系统！");
                 break;
             }
             else {
                 int t=3-count;
                 System.out.println("输入错误，你还有"+t+"次机会");
                 count++;
                 continue;
             }

         }
         if(count>3)
         {
             System.out.println("对不起，你3次输入均错误");
         }
    }

}
